<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="https://cdn.bootcss.com/angular.js/1.6.3/angular.min.js"></script>
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	 <style>
	 	body{
			font-size:12px;
		}
	 	table,
		th,
		/* td {
			border: 1px solid #ccc;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}		 */
		table td:nth-child(even) {
			
		}
		table tr:nth-child(2) {
			background-color:#f1f1f1;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
		#tt a{
			width:150px;
			height:50px;
			display:block;
			background:rgba(0,0,0,0.8);
			text-align:center;
			line-height:50px;
			float:left;
			margin-left:30px;
			font-size:20px;
			color:#fff;
		}
	 </style>
	<body ng-app="myApp" ng-controller="customersCtrl">
		<div class="">
			<div id="sho"></div>
		    <!--更新用户账户信息-->
			<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">
				
				<tbody>
					<tr>
						<td id="tt" colspan="13">
							<a href="全平台交易信息.html">全部</a>
							<a href="全平台交易信息-充值.html">充值</a>
							<a href="全平台交易信息-提现.html">提现</a>
							<a href="全平台交易信息-待结算.html">待结算</a>
							<a href="全平台交易信息-支付.html">支付</a>
						</td>
					</tr>
					
					<tr style="font-size:15px;background:rgb(0, 122, 255);color:#fff">
						<td style="width:55px;" class="text-center">序号</td>
						<td class="text-center">交易日期</td>
						<td class="text-center">手机号</td>
						<td class="text-center">通道</td>
						<td class="text-center">品牌</td>
						<td class="text-center">刷卡费率</td>
						<td class="text-left">出款卡</td>
						<td class="text-center">总金额</td>
						<td class="text-center">实际金额</td>
						<td class="text-center">订单号</td>
						
						<td class="text-center">备注信息</td>
						<td class="text-center">描述</td>
						<td class="text-center">类型</td>
						<td class="text-center">状态</td>
						
					</tr>
					<tr id="show" ng-repeat="item in items">
						<td class="text-center">{{$index+1}}</td>
						<td class="text-center">{{item.createTime | date:'yyyy-MM-dd'}}</td>
						<td class="text-center">{{item.phone}}</td>
						<td class="text-center">{{item.channelname}}</td>
						<td class="text-center">{{item.brandname}}</td>
						<td class="text-center">{{item.rate}}</td>
						<td class="text-left">{{item.bankcard}}</td>
						<td class="text-center">{{item.amount | currency:"￥ "}}</td>
						<td class="text-center">{{item.realAmount | currency:"￥ "}}</td>
						<td class="text-center">{{item.ordercode}}</td>						
						
						<td class="text-center">{{item.remark}}</td>
						<td class="text-center">{{item.desc}}</td>
						<td class="text-center">{{item.type | modify:item.type}}</td>
						<td class="text-center">{{item.status | modify2:item.status}}
						<!-- <img style="width:30px;height:30px;" src="images/成功.png" alt="" /> -->
						</td>
						
					</tr>
					<tr>
						<td colspan="13" id="show01" class="text-center">
							第<input class="form-control" id="ye" ng-init="ye=1" ng-model="ye" style="width:50px;display:inline-block" type="text"/>页
							<button class="btn btn-default" ng-click="xia()">跳转</button>总共{{pages}}条数据    当前一共{{page}}页
							<button class="btn btn-default" ng-click="home()">首页</button>
							<button class="btn btn-default" ng-click="sh()">上一页</button>
							<button class="btn btn-default" ng-click="next()">下一页</button>
							<button class="btn btn-default" ng-click="last(page)">尾页</button>
						</td>
					</tr>
				</tbody>
			</table>		
		</div>
		</div>
	</body>
	<script>
		$(function(){		
		})
	</script>
	<script>
		var app = angular.module('myApp', []);

	   /*自定义过滤器   1*/
		app.filter("modify",function(){
			return function(input,param){
				if(param == 0){
					return param = "💳充值"
				}
				if(param == 1){
					return param = "💵支付"
				}
				if(param == 2){
					return param = "💰提现"
				}
				if(param == 3){
					return param = "退单"
				}
				input = param
				return input
			}
		})
		/*自定义过滤器   2*/
		app.filter("modify2",function(){
			return function(input,param){
				if(param == 0){
					return param = "⏰待完成"
				}
				if(param == 1){
					return param = "✅已成功"
				}
				if(param == 2){
					return param = "❌已取消"
				}
				if(param == 3){
					return param = "待处理"
				}
				if(param == 4){
					return param = "⌚待结算"
				}
				input = param
				return input
			}
		})
		/*过滤器*/
		app.filter("modify3",function(){
			return function(input,param){
				
				if(param == 3){
					return param = "雷闪付"
				}
				
				input = param
				return input
			}
		})
        app.controller('customersCtrl', function($scope, $http ){
        	/*根据登陆信息获取token*/
        	var token = sessionStorage.getItem(key=1)
        	var brandid = sessionStorage.getItem(key = 3)
        	console.log(brandid)
        	/*直接或分页查询交易明细*/
				$http({
					method:'POST',
					params:{size:20,page:0,brand_id:brandid,type:0,status:4},					
					url: window.baseUrl+"transactionclear/payment/query/all"					
				}).then(function successCallback(data){
					console.log("直接或分页查询交易明细成功...")
					console.log(data.data)
					$scope.items = data.data.result.content
					$scope.pages = data.data.result.totalElements
					$scope.page  = data.data.result.totalPages
					/*$scope.size = */
				}, function errorCallback(data) {
						console.log("直接或分页查询交易明细失败...")
				     	console.log(data)
				});
				$scope.xia = function(){
					var brandid = sessionStorage.getItem(key = 3)
					var ye = document.getElementById("ye").value-1;
					$http({
					method:'POST',
					params:{size:20,page:ye,brand_id:brandid,type:0,status:4},					
					url: window.baseUrl+"transactionclear/payment/query/all"					
					}).then(function successCallback(data){
						console.log("直接或分页查询交易明细成功...")
						console.log(data.data)
						$scope.items = data.data.result.content
						$scope.pages = data.data.result.totalElements
						$scope.page  = data.data.result.totalPages
					}, function errorCallback(data) {
							console.log("直接或分页查询交易明细失败...")
					     	console.log(data)
					});
				}
				/*回到首页*/
				$scope.home = function(){
					var brandid = sessionStorage.getItem(key = 3)
					$scope.ye = 1;
                    $http({
                        method:'POST',
                        params:{size:20,page:$scope.ye-1,brand_id:brandid,type:0,status:4},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });
				}
				/*到达最后一页*/
				$scope.last = function(page){
					var brandid = sessionStorage.getItem(key = 3)
				    console.log(page);
                    $http({
                        method:'POST',
                        params:{size:20,page:page-1,brand_id:brandid,type:0,status:4},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });
                    $scope.ye = page
				}
				$scope.next = function(){
					var brandid = sessionStorage.getItem(key = 3)
				   var ye =  $scope.ye+=1;
				   console.log(ye-1)
                    $http({
                        method:'POST',
                        params:{size:20,page:ye-1,brand_id:brandid,type:0,status:4},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });
				}
				$scope.sh = function(){
					var brandid = sessionStorage.getItem(key = 3)
				    var ye = $scope.ye-=1;
				    ye = ye-1;
				    console.log(ye);
				    if(ye <= 0){
				        $scope.ye = 1;
				        console.log(ye)
					}
                    $http({
                        method:'POST',
                        params:{size:20,page:ye,brand_id:brandid,type:0,status:4},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });

				}
        })
	</script>
	<script>
		$(function(){
			var cf = $('.text-center').html();
			console.log(cf)
		})
	</script>
</html>

